///////////////////////////////////////////////////////////////////////
// File:        Sink.h
// Description: 
// Author:      Philip Kommnick
// Created:     Fri September 11 12:14:29 CEST 2009
//
// This program is open source. For license terms, see the LICENSE file.
//
///////////////////////////////////////////////////////////////////////

#pragma once

typedef std::pair<std::wstring, std::wstring> FileType;
typedef std::vector<FileType> TypesList;
#define MAKEFTYPE(a,b) std::make_pair<std::wstring, std::wstring>(a,b)

class Sink
{
public:
	Sink();
	virtual ~Sink(void);
	virtual void Output(Gdiplus::Bitmap &bmp) = 0;
protected:
	void InitFileDlg(TypesList &fileTypes);
	bool RequestFileName(std::wstring title);
	const std::wstring GetFileName() const { return fileName; };
	const std::wstring GetFileExt() const { return fileExt; };
private:
	inline UINT CreateFileExt(void);
    //LPOPENFILENAME fileDlg;
	IFileSaveDialog *saveDlg;
	std::wstring fileName;
	std::wstring fileExt;
	std::vector<std::wstring> fileExtList;
	//std::map<DWORD, std::wstring> fileExtMap;
    static unsigned int outCount;
};